package com.dragon.modules.yuegou.service.points;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dragon.common.web.PageRequest;
import com.dragon.modules.yuegou.entity.points.DetailEntity;
import com.dragon.modules.yuegou.model.points.Detail;
import com.dragon.modules.yuegou.model.system.Document;
import com.dragon.modules.yuegou.query.points.PointDetailQuery;
import com.dragon.modules.yuegou.query.points.PointSumQuery;
import org.springframework.web.multipart.MultipartFile;

import java.math.BigDecimal;
import java.util.List;

/**
 * 积分获取明细 服务接口
 *
 * @author pbuilder generated
 * @date 2019-04-02 17:40:47
 * @version 2.0
 */
public interface DetailService extends IService<DetailEntity> {

	/**
	 * 积分记录分页列表
	 */
	IPage<Detail> searchDetail(PageRequest page, PointDetailQuery query);

	/**
	 * 导出积分记录
	 */
	Document exportDetail(PointDetailQuery query);

	/**
	 * 保存兑换积分明细
	 */
	void saveDetail(String busdId, String memberId, BigDecimal cost, Integer points);

	/**
	 * 积分增减接口
	 */
	Integer pointANS(Detail detail);

	/**
	 * 积分导入接口
	 */
	void importPoint(String busdId, MultipartFile file);
	
	public Document getImportPointTemplate();

	String checkMember(String mobile, String busdId);

	/**
	 * 获取指定商圈下指定用户id的累计积分
	 * @param query
	 * @return
	 */
	BigDecimal getSumPointsByMemberId(PointSumQuery query);

	/**
	 * 计算积分
	 * @param merchantId
	 * @param memberId
	 * @param money
	 * @param isonline 是否线上
	 * @return
	 */
	Integer calculationOfIntegral(String busdId,String merchantId,String memberId,BigDecimal money,boolean isonline);

    List<Detail> searchTheAll();
}